﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Layouts/Monoblock.Master" AutoEventWireup="true" CodeBehind="Details.aspx.cs" Inherits="ScrumBox.Web.Views.Sprint.Details" %>
<%@ Import Namespace="ScrumBox.Web.Controllers"%>
<%@ Import Namespace="MvcContrib"%>
<%@ Import Namespace="ScrumBox.Model"%>
    
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <script type="text/javascript">
        $(document).ready(function() 
        {
          $('#startDate').datepicker();
          $('#endDate').datepicker();
        });
    </script>

    <%  var sprint = ViewData.Get<Sprint>(); %>
    
    <h2 class="title"><%= sprint.Title %></h2>
	<p class="meta">Last Edited by <a href="#">mick</a> on June 13, 2008 </p>
    <div class="entry">
        <fieldset>
        <legend>Details</legend>
        
            <label for="title">Title</label>
            <%= Html.TextBox("title", sprint.Title ?? "", new { @class = "required" })%>
            <span class="info">The title of the sprint.</span>

            <label for="startDate">Starts</label>        
            <%= Html.TextBox("startDate", sprint.StartDate.HasValue ? sprint.StartDate.Value.ToShortDateString() : "",
                          new { @class = "required" })%>
            <span class="info">The start date of the sprint.</span>                      
                          
            <label for="endDate">Ends</label>        
            <%= Html.TextBox("endDate", sprint.EndDate.HasValue ? sprint.EndDate.Value.ToShortDateString() : "",
                          new { @class = "required" })%>     
            <span class="info">The end date of the sprint.</span>
                                           
            <%= Html.Hidden("projectKey", sprint.Project.Key) %>
        
        
        </fieldset>   
        <br />
        <fieldset>
        <legend>Backlog Items</legend>
            <table id="sprints" cellspacing="0">
                <tr>
                    <th>Description</th>
                </tr>
                <% if (sprint.GetSprintBackLogItems().Count > 0){ %>
                <% foreach (var sprintBackLogItem in sprint.GetSprintBackLogItems())
                   { %>
                <tr>
                    <td><%= sprintBackLogItem.Title %></td>
                </tr>
                <% } %>
                <% } %>
            </table>   
        </fieldset>
    </div>
</asp:Content>
